package com.shop.config;

import org.apache.http.HttpHost;
import org.elasticsearch.client.RestClient;
import org.elasticsearch.client.RestHighLevelClient;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @BelongsProject: shop
 * @BelongsPackage: com.shop.config
 * @Author: GaoDo
 * @CreateTime: 2020-11-24 16:51
 * @Description: elasticsearch的配置类
 */
@Configuration
public class ESConfig {
    @Bean
    public RestHighLevelClient restHighLevelClient(){
        RestHighLevelClient client = new RestHighLevelClient(
                RestClient.builder(
                        new HttpHost("139.224.27.168", 9200, "http")
                        ));
        return client;
    }
}
